Since turning in a Java code challenge (mentioned in a previous post) I've been familiarizing myself with design patterns. I realized they kept coming up while reading up on Java-- there's been a few blogs and YouTube channels that have been pretty good at showing overall Java goodness, but I snagged the following from Derek Banas, check him out here.
I tend to forget things so I figure throwing a little post up with main pointers of what makes what... I got something to check out for a referesher later on.
3 categories: Creational, Behavorial, Structural
Creational Patterns
I came across: Strategy, Observer, Factory, Abstract, Singleton, Builder, Prototype.
Strategy Pattern
lets algorithms vary independently from clients that use it; define a family of algorithms, encapsulate each one, make them interchangeable.
Observer Pattern
: object called subject maintains a list of dependents called observers and notifies them automatically of any state changes, usually by calling one of their methods.
Factory Pattern
: allows you to create objects without specifying the exact class of object that will be created.
Abstract Factory Pattern
: similar to factory, except everything is encapsulated.
Singleton Pattern
is used when you want to eliminate the option of instantiating more than one object
Builder Pattern
: used to create objects made from a bunch of other objects
Prototype Pattern
: